package com.portal.flowable.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.portal.flowable.domain.biz.FlowBiz;
import com.portal.flowable.domain.dto.FlowTaskDto;
import com.portal.flowable.domain.vo.FlowQueryVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商业映射器
 * 自定义mapper
 * <P>自定义flowable查询sql</P>
 *
 * @author novice
 * @date 2024/12/28
 */
public interface FlowBizMapper extends BaseMapper<FlowBiz> {
    /**
     * 选择我进程
     *
     * @param page        页面
     * @param startUserId 创建用户id
     * @param flowQueryVo 流程查询vo
     * @return {@link Page}<{@link FlowTaskDto}>
     */
    Page<FlowTaskDto> selectMyProcess(Page<FlowTaskDto> page,
                                      @Param("startUserId")Long startUserId,
                                      @Param("flowQueryVo") FlowQueryVo flowQueryVo);

    /**
     * 选择待办事项列表
     *
     * @param page        页面
     * @param userId      用户id
     * @param instanceId  实例id
     * @param roleIds     角色id
     * @param flowQueryVo 条件
     * @return {@link Page}<{@link FlowTaskDto}>
     */
    Page<FlowTaskDto> selectTodoList(Page<FlowTaskDto> page,
                                     @Param("userId")Long userId,
                                     @Param("instanceId")String instanceId,
                                     @Param("roleIds")List<String> roleIds,
                                     @Param("flowQueryVo")FlowQueryVo flowQueryVo);

    Page<FlowTaskDto> selectFinishedList(Page<FlowTaskDto> page,
                                         @Param("auditUserId")Long auditUserId,
                                         @Param("flowQueryVo")FlowQueryVo flowQueryVo);
}
